<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Oneplatform企业级开发平台</title>
  <link rel="stylesheet" type="text/css" href="/assets/css/login.css">
  <link rel="stylesheet" type="text/css" href="/assets/layui/css/layui.css">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
</head>
<body>
  <div class="header">
    <div class="headerLayout w1200">
      <div class="headerCon">
        <h1 class="mallLogo">
          <a href="#" title="Oneplatform">
            <img src="/assets/img/logo.png">
          </a>
        </h1>
      </div>
    </div>
  </div>


  <div class="content content-nav-base  login-content">
    <div class="login-bg">
      <div class="login-cont w1200">
        <div class="form-box">
          <form class="layui-form" action="" method="post">
            <legend>账号登录</legend>
            <div class="layui-form-item">
              <div class="layui-inline iphone">
                <div class="layui-input-inline">
                  <i class="layui-icon layui-icon-username iphone-icon"></i>
                  <input type="text" name="loginName" id="loginName" lay-verify="required" placeholder="请输入登录账号" autocomplete="off" class="layui-input">
                </div>
              </div>
              <div class="layui-inline iphone">
                <div class="layui-input-inline">
                  <i class="layui-icon layui-icon-password iphone-icon"></i>
                  <input type="password" name="password" id="password" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
              </div>
             <!--  <div class="layui-inline veri-code">
                <div class="layui-input-inline">
                  <input id="pnum" type="text" name="pnum" lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input">
                  <input type="button" class="layui-btn" id="find"  value="验证码" /> 
                </div>
              </div> -->
            </div>
            <div class="layui-form-item login-btn">
              <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="login">登录</button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>

  <div class="footer">
    <br>
    <div class="mod_help w1200">                                     
      <p>
        <a href="javascript:;">关于我们</a>
        <span>|</span>
        <a href="javascript:;">找回密码</a>
        <span>|</span>
        <a href="javascript:;">帮助说明</a>
      </p>
      <p class="coty">爱员工版权所有 &copy; 2015-2020</p>
    </div>
  </div>
</body>
<script type="text/javascript" src="/assets/layui/layui.js"></script>
		<script>    
		    layui.config({
			  version: '20190621',
			  base : '/assets/plugins/'
			});
			layui.use(['layer', 'form','jeesuitelayui'], function() {
				var layer = layui.layer,
					$ = layui.jquery,
					jeesuitelayui = layui.jeesuitelayui,
					form = layui.form;
				
				form.on('submit(login)',function(data){
					var loading = layer.load();
					$.ajax({
						dataType:"json",
					    type: "POST",
				        url: '/api/u/login',
				        contentType: "application/json",
				        data:JSON.stringify(data.field) ,
						complete: function(){layer.close(loading);},
						success: function(data){
					        if(data.code==200){
					        	jeesuitelayui.success('登录成功');
					        	 setTimeout(function(){window.location.href = './index.html';},500);
					          }else{
					        	  jeesuitelayui.error(data.msg);
					          }
					        },
						error: function(xhr, type){
							jeesuitelayui.error('系统错误');
						}
					});
					return false;
				});
			});
		</script>
</html>